/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.gc.cscott.fs;

import java.io.File;

/**
 *
 * @author mamonov_ds
 */
public class RenameTool {
    public static void main(String[] args) {
        for(File testDir:new File("D:/temp/cscott-pack/contest/tests/tests8").listFiles()){
            if (testDir.isDirectory()){
                for(File testFile:testDir.listFiles()){
                    if (testFile.getName().contains("output.txt")){
                        System.out.println("RENAME "+testFile.getAbsolutePath()+" ot output1.txt");
                        File outFile = new File(testFile.getParent(), "output1.txt");
                        if(outFile.exists()){
                            outFile.delete();
                        }
                        testFile.renameTo(outFile);
                    } else {
                        //testFile.renameTo(new File(testFile.getParent(), "input.txt"));
                    }
                }
            }
        }
    }
}
